<?php
declare(strict_types=1);
// 支付
namespace app\tjy_v1\controller;
use app\tjy_v1\model\User as MYSQL; //导入模型
class Pay
{
    // 获取支持支付的列表
    public function PaymentList()
    {
        $query = request()->param(); //请求参数
        $apidb = [
            'code' => 200,
            'time' => time(),
            'msg' => "获取支持支付的列表",
            'query' => $query,
            'db' => [
                "list" => [
                    [
                        "name" => "余额支付",//支付产品
                        "icon" => "/static/icon/balance.png",
                        "note" => "当前可用余额201.00",//注释
                        "pay_code" => "balance_pay",//支付产品标识
                        "disabled" => 0,//是否停用
                        "api_url" => "http://127.0.0.1:81/tjyv1/Order/pay"//支付请求API网址
                    ],
                    [
                        "name" => "线下支付",
                        "icon" => "/static/icon/balance.png",
                        "note" => "线下收货时物流代收货款",
                        "pay_code" => "btl_pay",
                        "disabled" => 0,
                        "api_url" => "http://127.0.0.1:81/tjyv1/Order/pay"
                    ],
                    [
                        "name" => "微信支付",
                        "icon" => "/static/icon/wxpay.png",
                        "note" => "使用微信支付",
                        "pay_code" => "wx_pay",
                        "disabled" => 0,
                        "api_url" => "http://127.0.0.1:81/tjyv1/Order/pay"
                    ],
                    [
                        "name" => "支付宝支付",
                        "icon" => "/static/icon/alipay.png",
                        "pay_code" => "ali_pay",
                        "note" => "暂不支持",
                        "color" => "#F30",
                        "disabled" => 1,
                        "api_url" => "http://little-mall.demo.taoshatec.com/v1/pay/alipay"
                    ]
                ]
            ],
        ];
        return json($apidb);
    }



    
    // 订单正式支付
    public function pay()
    {
        $query = request()->param(); //请求参数
        // order_sn//订单编号
        $apidb = [
            'code' => 200,
            'time' => time(),
            'msg' => "订单正式支付",
            'query' => $query,
            'db' => [],
        ];
        return json($apidb);
    }

}
